//
//  AffairSearchView.h
//  GuangzhouWireless
//
//  Created by 泉 汉水 on 11-5-24.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "BookItem.h"
#import "DBUtil.h"
#import "CommonUtil.h"

#import "NSURL+DumbDownload.h"
#import "DumbDownloadManager.h"

#import "ReaderViewController.h"
#import "HubuAppDelegate.h"
#import "HubuViewController.h"

@interface BookReadView2 : UIView<DumbDownloadManagerDelegate, ReaderViewControllerDelegate> {
    
    BookItem *localBookItem;
    UILabel *titleLabel;
    UIImageView *coverImageView;
    UIButton *buyButton;
    UIButton *deleteSelectedButton;
    id *parentObject;
    
    BOOL bookDelete;
    
    UIActivityIndicatorView *waitingView;
}

@property(nonatomic) id *parentObject;
@property(nonatomic, retain) BookItem *localBookItem;
@property(nonatomic, retain) IBOutlet UILabel *titleLabel;
@property(nonatomic, retain) IBOutlet UIImageView *coverImageView;
@property(nonatomic, retain) IBOutlet UIButton *buyButton;
@property(nonatomic, retain) IBOutlet UIButton *deleteSelectedButton;
@property(nonatomic, retain) IBOutlet UIActivityIndicatorView *waitingView;
@property(nonatomic, assign) BOOL bookDelete;

-(void)initExtend:(BookItem *)bookItem;

-(IBAction)readButtonClick:(id)sender;

-(void) loadImage:(NSString *)url;
-(void) writeToFile:(NSData *)data;

-(IBAction)deleteBookSelect:(id)sender;
@end
